Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a buffer pool in report.ReadBinary() to reduce garbage-collection #3255

Merged
merged 2 commits into from
Jul 4, 2018

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Jul 4, 2018

I noticed in a profile that a lot of memory is allocated and discarded in this activity.

Benchmark run with 78 reports of around 1-3MB uncompressed:

Before (best of 5):

BenchmarkReportUnmarshal-2   	       1	1242562071 ns/op	427326232 B/op	 2631780 allocs/op

After:

BenchmarkReportUnmarshal-2   	       1	1035790710 ns/op	188397000 B/op	 2630861 allocs/op

@bboreham bboreham requested a review from rade July 4, 2018 13:45
@bboreham bboreham added the performance Excessive resource usage and latency; usually a bug or chore label Jul 4, 2018
@bboreham bboreham merged commit 777360d into master Jul 4, 2018
@bboreham bboreham deleted the report-bufferpool branch July 9, 2018 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Excessive resource usage and latency; usually a bug or chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants